package com.mg.controller;

import com.github.pagehelper.PageInfo;
import com.mg.dto.DataCodeDto;
import com.mg.dto.SimpleResult;
import com.mg.model.DataCode;
import com.mg.service.DataCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by mg1213 on 2018/3/18.
 */
@Controller
@RequestMapping("/dataCode")
public class DataCodeController {
    @Autowired
    private DataCodeService dataCodeService;

    @RequestMapping(value = "/admin/selectPageInfo")
    @ResponseBody
    public PageInfo<DataCodeDto> selectPageInfo(DataCodeDto dto, int limit, int start) {
        return dataCodeService.selectPageInfo(dto, start, limit);
    }
    @RequestMapping(value = "/admin/insertDataCode")
    @ResponseBody
    public SimpleResult insertDataCode(DataCode record) {
        return dataCodeService.insertDataCode(record);
    }
    @RequestMapping(value = "/admin/updateDataCode")
    @ResponseBody
    public SimpleResult updateDataCode(DataCode record) {
        return dataCodeService.updateDataCode(record);
    }
    @RequestMapping(value = "/admin/deleteDataCode")
    @ResponseBody
    public SimpleResult deleteDataCode(String ids) {
        return dataCodeService.deleteDataCode(ids);
    }

}
